//
//  MMGPictureCell.swift
//  MyMicroblog
//
//  Created by Mac on 17/1/9.
//  Copyright © 2017年 itcast. All rights reserved.
//

import UIKit

class MMGPictureCell: UICollectionViewCell {

    @IBOutlet weak var imgView: UIImageView!
    @IBOutlet weak var gifImageView: UIImageView!
    
    // 提供图片地址
    var pictureInfo: MMGPictureInfoDTO? {
        didSet{
//            let url = URL(string: pictureInfo?.thumbnail_pic ?? "")
            imgView.sd_setImage(with: pictureInfo?.iamgeURL)
            gifImageView.isHidden = !((pictureInfo?.thumbnail_pic?.hasSuffix(".gif")) ?? false)
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        backgroundColor = UIColor.red
    }

}
